<template>
  <div class="main">
    main组件
    <div>count的值： {{ count }}</div>
    <btn-s @add="add" @sub="sub"
    @addN="addN"></btn-s>
  </div>
</template>
<script>
import BtnS from './countPage.vue'
export default {
  components: {
    BtnS
  },
  data () {
    return {
      count: 0
    }
  },
  methods: {
    add () {
      this.count++
    },
    sub () {
      this.count--
    },
    addN (num) {
      this.count += num
    }
  }
}
</script>
<style scoped>
</style>
